package com.crrc.dataparse.monitor.rsp.service.parse.treat.templatepara.datatrans;

import com.crrc.dataparse.templatepara.IDataTrans;
import com.crrc.dataparse.templatepara.datatrans.utils.DataTranslator;

/*
     2进制转10进制(Int)高端在前
 */
public class BinaryToDecimalist2 extends IDataTrans {
    public BinaryToDecimalist2() {
    }
    @Override
    public String trans(String value, double resolusion, double offset) {
        if (!DataTranslator.isValid(value)) {
            return null;
        } else {
            long result = Long.valueOf(value, 2);
            return String.valueOf(result);
        }
    }
}
